//
//  YZNetworkManager+Activity.m
//  YZMicroStock
//
//  Created by apple on 17/5/10.
//  Copyright © 2017年 cqjr. All rights reserved.
//

#import "YZClient+Activity.h"

@implementation YZNetworkManager (Activity)

-(void)Activity_activityListsuccess:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params = @{@"device":@"3"};
    [self.mainNetwork cq_noCacheGET:URL_FOR_FETCH_ACTIVITY_LIST parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}

-(void)Activity_activityListNextWithactivityId:(NSInteger )activityId success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{@"device":@"3",@"activityId":@(activityId)};
    [self.mainNetwork cq_noCacheGET:URL_FOR_FETCH_ACTIVITY_LIST_NEXT parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}

-(void)Redpacket_fetchActivityListInfoWithTitle:(NSString *)title awardLogId:(NSInteger)awardLogId money:(NSInteger)money Success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *param = @{COMMON_REQUEST_DEVICE:COMMON_REQUEST_DEVICE_VALUE,@"title":title,@"awardLogId":@(awardLogId),@"money":@(money)};
    [self.mainNetwork cq_noCachePOST:URL_FOR_FETCH_ACTIVITY_REDPACKET parameters:param
                             success:^(NSURLSessionDataTask *task, id responseObject) {
                                 if (success) {
                                     success(task, responseObject);
                                 }
                             } failure:^(NSURLSessionDataTask *task, NSError *error) {
                                 if (failure) {
                                     failure(error);
                                 }
                             }];
}

-(void)Activity_RedpacketInforsuccess:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{@"device":@"3"};
    [self.mainNetwork cq_noCacheGET:URL_FOR_FETCH_ACTIVITY_REDPACKET_INFOR parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}
-(void)Activity_fetchRedPacketFundDetailsuccess:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *param = @{COMMON_REQUEST_DEVICE:COMMON_REQUEST_DEVICE_VALUE};
    [self.mainNetwork cq_noCacheGET:URL_FOR_FETCH_ACTIVITY_REDPACKET_LIST parameters:param
                            success:^(NSURLSessionDataTask *task, id responseObject) {
                                if (success) {
                                    success(task, responseObject);
                                }
                            } failure:^(NSURLSessionDataTask *task, NSError *error) {
                                if (failure) {
                                    failure(error);
                                }
                            }];
}

@end
